{% extends 'bg.html' %}
{% load static %}
{% block impb %}
<style>
	@import url({% static './css/error.css' %});
</style>
<script language="javascript" src="{% static './js/jquery-2.1.4.js' %}"></script>
<script language="javascript" src="{% static './js/anime.min.js' %}"></script>
{% endblock %}

{% block content %}
<div class="container">
	<font>这个页面出了点问题</font><br>
	<font>_(:3」∠)_</font>
	<br>
	<br>
	<font class="statue"></font>
</div>
{% endblock %}
{% block impa %}
<script language="javascript">
	var time = {obj:0};
	var stat = document.querySelector(".statue");
	var stn = {{statno|safe}};
	var stl = "{{statna|safe}}";
	function rS(len) {
		len = len || 1;
		var $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
		var maxPos = $chars.length;
		var pwd = '';
		for (i = 0; i < len; i++) {
			pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
		}
		return pwd;
	}
	function rN(len) {
		len = len || 1;
		var $chars = '0123456789';
		var maxPos = $chars.length;
		var pwd = '';
		for (i = 0; i < len; i++) {
			pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
		}
		return pwd;
	}
	function rndi(){
		var pha = time["obj"];
		var to = 49;
		var l1 = stn.length;
		var l2 = stl.length;
		var pd = pha/to;
		l1 = Math.round(pd < 1 ? pd * l1 : l1);
		l2 = Math.round(pd < 1 ? pd * l2 : l2);
		var text = pha == 50 ? stn+" "+stl : rN(l1)+" "+rS(l2);
		console.log(text);
		console.log(pha);
		$(".statue").html(text);
	}
	var ani = anime({
		targets: time,
		obj: 50,
		easing:"easeOutQuint",
		round: 1,
		update: function(anim){
			rndi();
		}
	});
	$(document).ready(ani.play());
</script>
<style>
	footer {
		position: fixed;
		bottom: 0;
	}
</style>
{% endblock %}
